<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title></title>
	<script type="text/javascript">
		var colorArr=["red","green","blue","purple","yellow"];
		var size=16;
		var step=2;
		function toBig(){
			size+=step;
			document.getElementById("p1").style.fontSize=size+"px";
			document.getElementById("p1").style.color=colorArr[Math.floor(Math.random()*colorArr.length)];
		}
	</script>
</head>
<body>

<p id="p1">JavaScript从入门到精通</p>
<br>
<button type="button" onclick="toBig()">放大</button>

</body>
</html>